[t:/]$ 지식_

리눅스 프레임 버퍼 mmap으로 그림 그리기

2009/10/26

리눅스 프레임버퍼에서 mmap으로 고속 그리기하는 기본 와꾸다.

    pfbdata = (unsigned short *)mmap(0, fbvar.xres * fbvar.yres * 2, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);

    if((unsigned)pfbdata == (unsigned)-1)
    {
        perror("사대강 잘헌다..!!");
        exit(1);
    }    
        
    temp = pfbdata;
    
    for (y = 0; y < fbvar.yres; y++) {
        for (x = 0; x < fbvar.xres; x++) {
            *temp++ = 0xffff;
        }
    }
   
     munmap(pfbdata, fbvar.xres * fbvar.yres * 2);




공유하기













[t:/] is not "technology - root". dawnsea, rss